<?php
class Training_Form_User extends Zend_Form{
	
	public function init(){
		$this->setAction('')
			->setMethod('post')
			->setAttrib('id','appForm')
			->setAttrib('name','appForm')
			->setEnctype('multipart/form-data');
		
		//USER_NAME
		$user_name = new Zend_Form_Element_Text('user_name');
		$user_name->setLabel('User name:')
				  ->setDescription('Nhap username')
				  ->setRequired();		
		//$this->addElement($user_name);
		
		$email = new Zend_Form_Element_Text('email');
		$email->setLabel('Email:')
			  ->setDescription('Nhap dia chi email')
			  ->setRequired()
			  ->addValidator(new Zend_Validate_EmailAddress(),true);
		
		$content = new Zend_Form_Element_Textarea('content');
		$content->setLabel('Noi dung')
				->setDescription("Nhap noi dung ban thac mac vao day")	
				->setAttrib('cols', 80)
				->setAttrib('rows', 8);
		
		$group = new Zend_Form_Element_Select('group');
		$group->setLabel('Group name:')
				->addMultiOptions(array('Member','Manager','Admin'));
		
	/*	$editor = new Zendvn_Form_Element_CmsEditor('content');
		$this->addElement($editor);*/
		
		//SUBMIT
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('Save now');
		//$this->addElement($submit);
		
		$this->addElements(array($user_name,$group, $email,$content,$submit));
		
	}
}